import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'dva'
import { Row, Col, Card ,DatePicker,Table,Tag} from 'antd'
import { color } from 'utils'
import List from './List'

const NewFile = ({ location, dispatch, newfile, loading }) => {
	const {department1,department2,depTypes,infoList,infoData,userList,matter,contractor,archiving} = newfile
	// console.log(matter)
	const listProps ={
		department1,
		department2,
		depTypes,
		infoList,
		infoData,
		userList,
		matter,
		contractor,
		archiving,
		onDep(parentId){
			dispatch({
				type:'newfile/dep',
				payload:{
					parentId
				}
			})
		},
		onMenulist(id){
			dispatch({
				type:'newfile/menuList',
				payload:{
					id
				}
			})
		},
		onCreate(params){
			dispatch({
				type:'newfile/create',
				payload:{
					...params
				}
			})
		},
		onChage(params){
			dispatch({
				type:'newfile/upDocument',
				payload:{
					...params
				}
			})
		},
		onCreate1(params){
			dispatch({
				type:'newfile/create1',
				payload:{
					...params
				}
			})
		},
		onCreateApply(params){
			dispatch({
				type:'newfile/createApply',
				payload:{
					...params
				}
			})
		},
		onUpdate(params){
			dispatch({
				type:'newfile/update',
				payload:{
					...params
				}
			})
		},
		onUpdateApply(params){
			dispatch({
				type:'newfile/updateApply',
				payload:{
					...params
				}
			})
		},
	}
	

    return (
      <div className="content-inner" style={{backgroundColor:'transparent',padding:0}}>
      	<List {...listProps}/>
      </div>
    )
  
}
export default connect(({ newfile, loading }) => ({ newfile, loading }))(NewFile)
